<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/inc/incSession.jsp" %>
<%
	String member_id 	= util.getStr(request.getParameter("member_id"));
	String member_pw 	= util.getStr(request.getParameter("member_pw"));
	
	param.put("member_id",member_id);
	param.put("member_pw",member_pw);

	ArrayList rs =	(ArrayList)sqlMap.queryForList("Member.selectLogin",param);	//	실행할 SQL ID, 검색조건(없을경우 null)
	
	if(rs.size() > 0){
		session.setAttribute("S_IS_LOGINED", "Y");                             //세션에 값 입력
		session.setAttribute("S_EMAIL",     util.getStr(((HashMap)rs.get(0)).get("email"))); 
		session.setAttribute("S_MEMBER_ID", util.getStr(((HashMap)rs.get(0)).get("member_id")));
		session.setAttribute("S_NICKNAME",  util.getStr(((HashMap)rs.get(0)).get("nickname")));
%>
<script type='text/javascript'>
	alert("로그인 되었습니다");
	location.href="/";
</script>
<%
	} else {
%>
<script type='text/javascript'>
	alert("아이디/비밀번호를 확인해 주세요");
	history.back(-1);	
</script>
<%
	}
%>